import { CpasIcon } from "~/public/cpas-ui";
import { intl, rTime } from "@/utils";

export const columns = [
  {
    dataField: "dgsyh",
    dataType: "string",
    dataTypeCustom: "zh-string",
    caption: "索引号",
    alignment:"left",
    width:"100",
    allowResizing:true,
    allowHeaderFiltering:false
  },
  {
    dataField: "dgmc",
    dataType: "string",
    dataTypeCustom: "zh-string",
    caption: "底稿名称",
    alignment:"left",
    width:"200",
    allowResizing:true,
    allowHeaderFiltering:false,
    cellRender:(cell: any) => {
      if (cell.data.dglx === ".xlsx") {
        return (
          <>
            <span style={{ marginRight: '5px' }}> <CpasIcon type={"icon-exle"} fontSize={16} /></span>
            {cell.data.dgmc + cell.data.dglx}
          </>
        );
      } else {
        return (
          <>
            <span style={{ marginRight: '5px' }}> <CpasIcon type={"icon-word"} fontSize={16} /></span>
            {cell.data.dgmc + cell.data.dglx}
          </>
        );
      }
    }
  },
  {
    dataField: "fjCnt",
    dataType: "string",
    dataTypeCustom: "zh-string",
    headerCellRender:() => intl('paper.col.fjCnt', '附件'),
    alignment:"right",
    width:"100",
    allowResizing:true,
    allowHeaderFiltering:false,
  },
  {
    dataField: "editUser",
    dataType: "string",
    caption:  intl('paper.col.editUser', '编辑人'),
    dataTypeCustom: "zh-string",
    headerCellRender:() => intl('paper.col.fjCnt', '附件'),
    alignment:"left",
    width:"100",
    allowResizing:true,
    allowHeaderFiltering:false,
    cellRender:(cell: any) => {
      return <span style={{ marginRight: '5px' }}> {cell.data.editUser} &nbsp;&nbsp; {cell.data.editDate ? rTime(cell.data.editDate) : ''} </span>
    }  
  },
];